package com.wps.wdztv6.domain;

import com.wps.wdztv6.common.ResultEnum;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;

/**
 * 返回值结果集
 */
@Getter
@Setter
@NoArgsConstructor
@ToString
public class WdztResult {
    // 错误码 200正常
    private int code;
    // 错误提示
    private String message;
    // 错误提示详细信息
    private String details;
    // 自定义错误信息，当code为40007错误码时必填
    private String hint;

    public WdztResult(int code, String message, String details, String hint) {
        this.code = code;
        this.message = message;
        this.details = details;
        this.hint = hint;
    }

    public static WdztResult success(String message){
        return new WdztResult(200,message,null,null);
    }

    public static WdztResult failed(String details,String hint){
        return new WdztResult(40007, "打开文档失败",details,hint);
    }
}